﻿using System;
using System.Collections.Generic;
using System.Drawing;
using System.Windows.Forms;
using System.Reflection;
using System.IO;

namespace LizardChess
{
    public partial class frmRunTest : Form
    {
        public frmRunTest()
        {
            InitializeComponent();
        }
        /// <summary>
        /// Load the m_acurPieceCursors array with the cursors that are embedded in this assembly
        /// </summary>
        public void LoadCursors()
        {
            Assembly asmMain = Assembly.GetExecutingAssembly();
            string strAsmName = asmMain.GetName().Name;
            // The relative pathname of an embedded resource begins with a period
            string strPath = "LizardChess.Cursors.";

            m_acurPieceCursors[0] = new Cursor(asmMain.GetManifestResourceStream(strPath + "BlackBishop.cur"));
            m_acurPieceCursors[1] = new Cursor(asmMain.GetManifestResourceStream(strPath + "WhiteBishop.cur"));
            m_acurPieceCursors[2] = new Cursor(asmMain.GetManifestResourceStream(strPath + "BlackKing.cur"));
            m_acurPieceCursors[3] = new Cursor(asmMain.GetManifestResourceStream(strPath + "WhiteKing.cur"));
            m_acurPieceCursors[4] = new Cursor(asmMain.GetManifestResourceStream(strPath + "BlackKnight.cur"));
            m_acurPieceCursors[5] = new Cursor(asmMain.GetManifestResourceStream(strPath + "WhiteKnight.cur"));
            m_acurPieceCursors[6] = new Cursor(asmMain.GetManifestResourceStream(strPath + "BlackPawn.cur"));
            m_acurPieceCursors[7] = new Cursor(asmMain.GetManifestResourceStream(strPath + "WhitePawn.cur"));
            m_acurPieceCursors[8] = new Cursor(asmMain.GetManifestResourceStream(strPath + "BlackQueen.cur"));
            m_acurPieceCursors[9] = new Cursor(asmMain.GetManifestResourceStream(strPath + "WhiteQueen.cur"));
            m_acurPieceCursors[10] = new Cursor(asmMain.GetManifestResourceStream(strPath + "BlackRook.cur"));
            m_acurPieceCursors[11] = new Cursor(asmMain.GetManifestResourceStream(strPath + "WhiteRook.cur"));
        }
    }
}
